<?php
use Workerman\Worker;
use Workerman\Lib\Timer;

require_once __DIR__."/../Autoloader.php";

$work = new Worker("tcp://0.0.0.0:1234");
#4个进程
$work->name="workman";
$work->onWorkerStart=function($work){
    Timer::add(10,function()use($work){
            foreach ($work->connections as $connect){
                $connect->send(time());
            }
    });
};


Worker::runAll();